export function debounce() {
    let timer = null //延时器
    return function (func, wait = 2000, immediate) {
        let context = this;
        let args = arguments;
        if (timer) {
            clearTimeout(timer);
        }

        timer = setTimeout(function () {
            func.apply(context, args);
        }, wait);
        // debugger;
    };
}